<?php
if(!defined('MY_ROOT'))
{
throw new Exception("Access Denied");
}
$_G=array();
require_once(MY_ROOT.'/source/stdinc.php');
class core{
public static function instance()
{
static $object;
if($object==NULL){$object=new core();}
return $object;
}
function init()
{
global $_G;
global $config;
DB::init($config['db']);
SESSION::init($config['cookie']);
$_G['hwnd']['smarty']=new template();
}
function init_user()  //login by http html page
{
global $_G;
global $config;
$_G['hwnd']['member']=new member();
if(isset($_SESSION['uid']))
{
$_G['uid']=intval($_SESSION['uid']);
$_G['username']=$_SESSION['username'];
$_G['usercfg']=unserialize($_SESSION['usercfg']);
$_G['available']=$_SESSION['available'];
}else{
$_G['uid']=0;
//$_G['hwnd']['seccode']=new recaptcha($config['recaptcha']);
}
}
}
?>
